<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
	<script src="./js/jquery-1.8.2.min.js"></script>
</head>
<body>

<form method="post" id="addEditGoodsForm">
    <input type="hidden" value="111" name="aaa" class="input-txt"/>
    <input type="hidden" value="222" name="bbb" class="input-txt"/>
    <input type="hidden" value="333" name="ccc" class="input-txt"/>
    <input type="hidden" value="444" name="ddd" class="input-txt"/>
    <input name="att[]" value="111" />
    <input name="att[]" value="222" />
    <input name="token" value="135054fc00e71eef" />
</form>

<button id="btn_send" style="width: 100px;height: 100px" onclick="btn_send_click()" value="添加">添加</button>
<button id="btn_edit" style="width: 100px;height: 100px" onclick="btn_edit_click()" value="编辑">编辑</button>
</body>
<script>

    function btn_send_click() {

        var o = $('#addEditGoodsForm').serialize()
        console.log('addEditGoodsForm='+o);

        // $.post("http://longdi.jbxiong.com/admin/Storehouse/add_storehouse",
        //     {
        //         token:'135054fc00e71eef',
        //         storehouse:{'house_name':'河西唱K','house_ename':'eee','icon':'abc.png','long':1.111,'lat':2.22221,'city_id':1,'region_id':1,'address':'长沙市','telephone':'13647585485','site_area':'100','rental_area':200,'site_earea':101,'rental_earea':201,'html_msg':'aaaaa'},
        //         banner:['aaa.png','bbb.png'],
        //         landmark:[{'land_name':'aaa','land_ename':'bbb','distance':10,'storehouse_id':1,'land_id':1},{'land_name':'eee','land_ename':'fff','distance':10,'storehouse_id':1,'land_id':2}],
        //     },
        //     function(data,status){
        //         alert("数据: \n" + data + "\n状态: " + status);
        //     });

        $.post("http://longdi.jbxiong.com/admin/Storehouse/add_storehouse",
            o,
            function(data,status){
                alert("数据: \n" + data + "\n状态: " + status);
            });
    }


    function btn_edit_click() {
        $.post("http://longdi.jbxiong.com/admin/Storehouse/edit_storehouse",
            {
                token:'135054fc00e71eef',
                storehouse:{'house_id':'7','house_name':'河西唱11','house_ename':'111','icon':'1.png','long':11.111,'lat':21.22221,'city_id':2,'region_id':2,'address':'长沙市1','telephone':'13647585111','site_area':'111','rental_area':201,'site_earea':1011,'rental_earea':2011,'html_msg':'aaaaa1'},
                banner:['aaa1.png','bbb1.png'],
                landmark:[{'land_name':'aaa1','land_ename':'bbb1','distance':11,'land_id':1},{'land_name':'eee','land_ename':'fff','distance':10,'land_id':2}]
            },
            function(data,status){
                alert("数据: \n" + data + "\n状态: " + status);
            });
    }

</script>
</html>